<?php
$TaskId=$_GET['TaskId'];

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");
$sql="delete from Task where TaskId='{$TaskId}';";
$result = $db->exec($sql);

if ($result){
    echo "删除成功！<a href='task_list.php'>点击返回列表</a>";
}else {
    echo "删除失败";
}